package com.zhihuishu.micro.course.openapi.course;

import com.zhihuishu.micro.course.openapi.course.dto.CourseChapterDto;
import com.zhihuishu.remote.RemoteException;
import com.zhihuishu.remote.RemoteResult;

import java.util.List;

/**
 * @author Jiangli
 * @date 2016/10/17 13:57
 */
public interface CourseChapterOpenService {
    /**
     * 增加一个新的章
     * courseId not null
     * rank not null
     * @param courseChapterDto
     * @param createUserId
     * @return
     * @throws RemoteException
     */
    RemoteResult<CourseChapterDto> createByCourseId(CourseChapterDto courseChapterDto, long createUserId) throws RemoteException;

    /**
     * 更新某章数据
     * @param chapter
     * @param updateUserId
     * @return
     * @throws RemoteException
     */
    RemoteResult<Void> updateByDto(CourseChapterDto chapter ,long updateUserId) throws RemoteException ;

    /**
     * 删除某章
     * @param chapterId
     * @param deleteUserId
     * @return
     * @throws RemoteException
     */
    RemoteResult<Void> deleteById(Integer chapterId , long deleteUserId) throws RemoteException;

    /**
     * 查询课程下的章列表
     * @param courseId
     * @return
     * @throws RemoteException
     */
    RemoteResult<List<CourseChapterDto>> queryListByCourseId(long courseId) throws RemoteException ;

    /**
     * 查询课程下的章列表,包括节、小节列表
     * @param courseId
     * @return
     * @throws RemoteException
     */
    RemoteResult<List<CourseChapterDto>> queryListByCourseIdNonLazy(long courseId) throws RemoteException ;

    /**
     * 更新章顺序
     * @param chapterList
     * @param updateUserId
     * @return
     * @throws RemoteException
     */
    RemoteResult<Void> sortByDtoList(List<CourseChapterDto> chapterList ,long updateUserId) throws RemoteException ;

}
